data{
    int<lower=1> N;
    int C[N];
    int VB[N];
    int VT[N];
    int VC[N];
    int AVC[N];
}
parameters{
    real a;
    real bVC;
    real bVB;
    real bVT;
    real bAVC;
}
model{
    vector[N] lp;
    bAVC ~ normal( 0 , 10 );
    bVT ~ normal( 0 , 10 );
    bVB ~ normal( 0 , 10 );
    bVC ~ normal( 0 , 10 );
    a ~ normal( 0 , 10 );
    for ( i in 1:N ) {
        lp[i] = a + (bVC + bVB * VB[i] + bVT * VT[i]) * VC[i] + bAVC * AVC[i];
    }
    C ~ binomial_logit( 1 , lp );
}
generated quantities{
    vector[N] lp;
    real dev;
    dev = 0;
    for ( i in 1:N ) {
        lp[i] = a + (bVC + bVB * VB[i] + bVT * VT[i]) * VC[i] + bAVC * AVC[i];
    }
    dev = dev + (-2)*binomial_logit_lpmf( C | 1 , lp );
}
